<%--
  Created by IntelliJ IDEA.
  User: sujinran
  Date: 2018/4/9
  Time: 12:22
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>

<html>
<head>
    <title>编辑用户</title>

    <script type="text/javascript">
        function updateUser() {
            var form = document.forms[0];
            form.action = "<%=basePath%>/user/updateUser.do";
            form.method = "post";
            form.submit();
        }
    </script>

</head>
<body>
<h1>添加用户</h1>
<form action="" name="userForm">
    <input type="hidden" name="id" value="${user.id}"/> 姓名：<input
        type="text" name="username" value="${user.username}"/> 年龄：<input
        type="text" name="age" value="${user.age}"/> <input type="button"
                                                             value="编辑" onclick="updateUser()"/>
</form>
</body>

</html>